<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>聊天室登录</title>
<script type="text/javascript">
	function login() {
		var username = document.getElementById("username").value;
		var password = document.getElementById("password").value;
		if (username.length == 0 || username == "") {
			alert("请输入用户名!");
			return false;
		} else if (password.length == 0 || password == "") {
			alert("请输入密码!");
			return false;
		}
		return document.forms[0].submit();
	}

	function toRegist() {
		window.location.href = "<%=request.getContextPath()%>/jsp/regist.jsp";

	}
</script>
</head>
<body>
	<form action="./login.do" method="post">
		<table align="center" style="border: 1px solid gray">
			<tr align="center">
				<td colspan="2">登陆</td>
			</tr>
			<tr>
				<td>用户名:</td>
				<td><input type="text" name="username" id="username"></td>
			</tr>
			<tr>
				<td>密 &nbsp&nbsp码:</td>
				<td><input type="password" name="password" id="password"></td>
			</tr>
			<tr align="center">
				<td colspan="2">
					<input type="button" onclick="login()" value="登陆"> 
					<input type="reset" value="重置">
					<input type="button" onclick="toRegist()" name="regist" value="注册新用户">
				</td>
			</tr>
		</table>
	</form>
</body>
</html>